INSERT INTO cat_wantad
SELECT top 200 
newid() AS [Id],213010 AS [AreaCode],title AS [Text],null AS [TextStyle],null AS [SubText],link AS [NavigateUrl],NULL AS [ImageUrl],NULL AS [ImageBinary],NUll AS [MimeType],NULL AS [Width],NULL AS [Height],NULL AS [AlternateText],UpdatedDate AS [StartDate],Expireddate AS [EndDate],Case Approvedwhen 1 then 1else 0 end AS [IsPosted],ApprovedDate AS [DatePosted],NULL AS [SortOrder],visitedcount AS [Clicks],NULL AS [Notes],3 AS [Status],CreatedDate AS [DateCreated],UpdatedDate AS [LastUpdated],case len(convert(varchar(10),companyid))
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),companyid) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),companyid) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),companyid) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),companyid) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),companyid) 
    end AS [CompanyId],NULL AS [OrderItemId]FROM srv_lnk.nchr2008.dbo.hotspotjobwhere ApprovedDate>'2012-7-1'
order by Expireddate desc
